//var menuTree;
var prefix = basepath + "/production"

var menuIds;
var enterpriseList;
var compPreviligeList;
var allinpayPreviligeList;
//$(function() {
////	getMenuTreeData();
////	validateRule();
//});
//$.validator.setDefaults({
//	submitHandler : function() {
////		getAllSelectNodes();
//		alert('ready to save')
//		save();
//	}
//});


function closeThis(){
	var index = parent.layer.getFrameIndex(window.name);
	parent.layer.close(index);
}

function save() {
	$('#menuIds').val(menuIds);
	var prod = $('#signupForm').serialize();
	console.log('prod:' + JSON.stringify(prod) )
	console.log('ready to call ' +  prefix + "/updateEnterpriseProd")
	$.ajax({
		cache : true,
		type : "POST",
		url : prefix + "/updateEnterpriseProd",
		data : prod, // 你的formid

		async : false,
		error : function(request) {
			alert("Connection error");
		},
		success : function(data) {
			if (data.code == 0) {
				alert("操作成功")
				parent.layer.msg("操作成功");
//				sleep(3000);
//				parent.reload();
				var index = parent.layer.getFrameIndex(window.name);
				parent.layer.close(index);

			} else {
				alert(data.msg)
				parent.layer.msg(data.msg);
			}
		}
	});
}



